package org.shoukaiseki.inittable.utils;


import org.shoukaiseki.inittable.domain.TableTriggerInfo;

/**
 * 触发器命名时，trg_表名_操作
 *
 * 函数过程命名时，采用动词+名词的形式表达其含义。
 * 序列命名时，seq_表名
 *
 **/
public final class TableTriggerInfoBuilder {
    private String triggerName;
    private String triggerSql;

    private TableTriggerInfoBuilder() {
    }

    public static TableTriggerInfoBuilder triggerName(String triggerName) {
        TableTriggerInfoBuilder tableTriggerInfoBuilder = new TableTriggerInfoBuilder();
        tableTriggerInfoBuilder.triggerName = triggerName;
        return tableTriggerInfoBuilder;
    }

    public TableTriggerInfoBuilder triggerSql(String triggerSql) {
        this.triggerSql = triggerSql;
        return this;
    }

    public TableTriggerInfo build() {
        TableTriggerInfo tableTriggerInfo = new TableTriggerInfo();
        tableTriggerInfo.setTriggerName(triggerName);
        tableTriggerInfo.setTriggerSql(triggerSql);
        return tableTriggerInfo;
    }
}
